<template>
    <div id="talking">
        <van-sticky>
            <van-nav-bar title="xx" left-text="返回" left-arrow @click="fh" />
        </van-sticky>
        <div id="talk_con">
            <Socket :username="user"></Socket>
        </div>
    </div>
</template>

<script setup lang="ts">
import Socket from './component/Socket.vue'
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { onMounted } from 'vue'

const user = ref('')
const route = useRoute()

const router = useRouter()

onMounted(() => {
    user.value = JSON.parse(localStorage.getItem('user')).username
})

const fh = () => {
    router.back()
}
</script>

<style scoped>
#talking {
    width: 100vw;
    height: 100vh;
    background: white;
    
    #talk_con {
        width: 100vw;
        min-height: 90vh;
        background-color: #f2f2f2;
        padding-top: 20px;
    }
}
</style>